# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-calculator
pkgver=5.8.23
pkgrel=3
pkgdesc='An easy to use calculator for ordinary users'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/deepin-calculator"
license=('GPL3')
depends=('deepin-qt5integration' 'deepin-qt-dbus-factory')
makedepends=('cmake' 'gmock' 'gtest' 'ninja' 'qt5-tools')
groups=('deepin-extra')
source=("https://github.com/linuxdeepin/deepin-calculator/archive/$pkgver/$pkgname-$pkgver.tar.gz"
        $pkgname-fix-ldflags.patch::https://github.com/linuxdeepin/deepin-calculator/pull/82.patch)
sha512sums=('f07d1c963a2647e946e5626a406cb9a3d6582d19bf21ee7706e6ff0a6e426859e2186f556cc84b157eec5a49f2434d5f585e345afae4b13a9014b354a1bf1add'
            '001b9ab4b7a9aac4ded51e9e2c0362824f3e38ad8a80c15c3cbe7cbfeef6ce65e85a4c3aa688fcdd0e396267a108fd6a192adece597e95775aece1c29a8c2a7c')

prepare() {
  patch -d deepin-calculator-$pkgver -p1 < $pkgname-fix-ldflags.patch
}

build() {
  cd deepin-calculator-$pkgver
  cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr .
  ninja
}

package() {
  cd deepin-calculator-$pkgver
  DESTDIR="$pkgdir" ninja install
}
